package cn.kgc.shiro;

import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * @author 课工场
 * @date 2024/3/25
 * @description  shiro中的密码加密操作
 */
public class TestMd5 {

    public static void main(String[] args) {

        String password = "123456";

        // e10adc3949ba59abbe56e057f20f883e
        String hex = new Md5Hash(password).toHex();
        System.out.println("hex = " + hex);

        // "123456"  + "java2323"   -> abfdd26ac2459a8c14825522da0ac050
        String hex1 = new Md5Hash(password, "java2323").toHex();
        System.out.println("hex1 = " + hex1);

        //  c8af6020a726e562745bcddeb66303ac
        String hex2 = new Md5Hash(password, "java2323", 10).toHex();
        System.out.println("hex2 = " + hex2);

    }
}
